<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<script type="text/javascript">
		(function(){
			
			 var Person = function(name, age){
				
				this.name = name;
				this.age = age;
				this.init = function(name, age){
					
					alert(this.name + "/" + this.age);
				};
				this.init();
			}
			
			//Person.a = function(){  这种方式就不行
			Person.prototype.a = function(){
				
				this.init();
			}
			
			var person = new Person('涂有', 23);
			person.a();
		}());
	</script>
  </head>
  
  <body>
    This is my JSP page. <br>
  </body>
</html>
